#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
typedef int long long;
#define MAX_N 50

int students[MAX_N + 5];
int posi_dp[MAX_N + 5][15];
int nega_dp[MAX_N + 5][15];
// 15是背包容量，n个学生是物品

int main()
{
    int n, k, d;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> students[i];
    cin >> k >> d;
    memset(posi_dp, 0xcf, sizeof(posi_dp));
    memset(nega_dp, 0x3f, sizeof(nega_dp));
    for (int i = 0; i <= n; i++)
        posi_dp[i][0] = 1, nega_dp[i][0] = -1;
    int ret = -0x3f3f3f3f;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= k; j++)
        {
            if (j > i)
                continue;
            for (int t = 0; t < i; t++)
            {
                if (t != 0 && i - t > d)
                    continue;
                if (students[i] > 0)
                {
                    if (posi_dp[t][j - 1] != 0xcfcfcfcf)
                    {
                        posi_dp[i][j] = max(posi_dp[t][j - 1] * students[i], posi_dp[i][j]);
                    }
                    if (nega_dp[t][j - 1] != 0x3f3f3f3f)
                    {
                        nega_dp[i][j] = min(nega_dp[t][j - 1] * students[i], nega_dp[i][j]);
                    }
                }
                else
                {
                    if (posi_dp[t][j - 1] != 0xcfcfcfcf)
                    {
                        posi_dp[i][j] = max(nega_dp[t][j - 1] * students[i], posi_dp[i][j]);
                    }
                    if (nega_dp[t][j - 1] != 0x3f3f3f3f)
                    {
                        nega_dp[i][j] = min(posi_dp[t][j - 1] * students[i], nega_dp[i][j]);
                    }
                }
            }
        }
        ret = max(ret, posi_dp[i][k]);
    }
    // for(int i = 0; i <= n; i++)
    // {
    //     for(int j = 0; j <= k; j++)
    //     {
    //         cout << posi_dp[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    cout << ret << endl;
    return 0;
}